﻿using System.ComponentModel;
using Loki.Engine;

namespace Loki.UI
{
    public class ConfirmViewModel : ViewModel<ServiceModel>
    {
        #region  DialogResult
        private static PropertyChangedEventArgs _DialogResultChangeArgs = ObservableHelper.CreateArgs<ConfirmViewModel>(x => x.DialogResult);

        private bool _DialogResult;

        public bool DialogResult
        {
            get
            {
                return _DialogResult;
            }

            set
            {
                if (value != _DialogResult)
                {
                    _DialogResult = value;
                    NotifyChanged(_DialogResultChangeArgs);
                }
            }
        }
        #endregion

        #region Message
        private static PropertyChangedEventArgs _MessageChangeArgs = ObservableHelper.CreateArgs<ConfirmViewModel>(x => x.Message);

        public string Message
        {
            get
            {
                return _Message;
            }

            set
            {
                if (value != _Message)
                {
                    _Message = value;
                    NotifyChanged(_MessageChangeArgs);
                }
            }
        }

        protected string _Message;
        #endregion

        public static ConfirmViewModel Confirm(string P_Test, params object[] P_Params)
        {
            ConfirmViewModel L_Dialog = new ConfirmViewModel();
            L_Dialog.Message = string.Format(P_Test, P_Params);
            return L_Dialog;
        }
    }
}
